package net.huashitong.oversee.web;

import com.sirdc.modules.core.web.JsonBaseController;
import com.sirdc.modules.core.web.model.Message;
import net.huashitong.oversee.JobTask.JobTaskService;
import net.huashitong.oversee.entity.SupervisionLog;
import net.huashitong.oversee.filter.TaskLogFilter;
import net.huashitong.oversee.service.FeedBackLeaderService;
import net.huashitong.oversee.service.SupervisionLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import static net.huashitong.node.utile.DateUtil.getNowDate;

@Controller
@RequestMapping(value = "/taskLog")
public class TaskLogCtrl extends JsonBaseController {
    @Override
    protected String getView(String s) {
        return null;
    }
    @Autowired
    private SupervisionLogService supervisionLogService;
    @Autowired
    private JobTaskService jobTaskService;
//    @ResponseBody
//    @RequestMapping(value = "/creat",method = RequestMethod.POST)
//    public Message creatTaskLog(@RequestBody TaskLogFilter filter){
//
//        SupervisionLog taskLog = new SupervisionLog();
//        taskLog.setDatatime(getNowDate());
//        taskLog.setRecord(filter.getRecord());
//        taskLog.setTaskName(filter.getTaskName());
//        taskLog.setSupervisionTeamId(filter.getSupervisionTeamId());
//        taskLog.setTaskId(filter.getTaskId());
//        supervisionLogService.save(taskLog);
//
//        return coverMessage("200", "创建成功",true);
//    }

    @ResponseBody
    @RequestMapping(value = "/testsend",method = RequestMethod.GET)
    public  String testSend()
    {
        jobTaskService.sendMsgToTM();
        return  "ok";
    }


}
